package test1;

import org.w3c.dom.ls.LSOutput;

public class GameTest {
    public static void main(String[] args) {

        Role r1 = new Role("暮婉柔", 20, 100, '女');
        Role r2 = new Role("裴擒虎", 30, 100, '男');
        while (true) {
            //r1攻击r2
            r1.attack(r2);
            //判断r2的剩余血量
            if (r2.getBlood() == 0) {
                System.out.println(r1.getName() + "K.O了" + r2.getName());
                break;
            }
            //r2攻击r1
            r2.attack(r1);
            //判断r2血量
            if (r1.getBlood() == 0) {
                System.out.println(r2.getName()+"K.O了" + r2.getName());
                break;
            }

        }
        System.out.print("恭喜完成！");
    }
}
